
#ifndef BASE_CONNECTOR_INCLUDED
#define BASE_CONNECTOR_INCLUDED

#include "tcpsocket.h"

class BASE_API BaseConnector : public TcpSocket
{
public:
	BaseConnector(Proactor* proactor,char* ip,unsigned short port);
	virtual ~BaseConnector();

	int Connect();
	int Send(const char* buff,long& size,int flags=0);
	int Recv(long size,int flags=0);

public:
	virtual pj_bool_t OnDataRead(void *data,pj_size_t size,int status,pj_size_t* remainder){return true;};
	virtual pj_bool_t OnDataSend(pj_ioqueue_op_key_t *send_key,int sendsize){return true;};
	virtual pj_bool_t OnConnect(int status){return true;};
};

#endif